
public class Account {
	private int id;
	private String name;
	private double amount= 0, interest;
	
	public Account(int id, String name, double interest) {
		this.id = id;
		this.name = name;
		this.interest = interest;
	}
	
	public boolean addInterest() {
		double oldAmount = amount;
		amount = amount * interest;
		if(amount != oldAmount) {
			return true;
		} else {
			return false;
		}
		
	}
	
	public boolean withdraw(double wAmount) {
		if(amount - wAmount < 0) {
			return false;	
		} else {
			amount = amount - wAmount;
			return true;
		}
	}
	
	public boolean deposit(double deposite) {
		if(deposite > 0) {
			amount = deposite + amount;
			return true;
		} else {
			return false;
		}
	}
	
	public void getAccountInfo() {
		System.out.println("-------------------------------------------");
		System.out.println("Account name: : " + name);
		System.out.println("Amount: " + amount + " Kr");
		System.out.println("Interest: " + interest);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getAmount() {
		return amount;
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

	public double getInterest() {
		return interest;
	}

	public void setInterest(double interest) {
		this.interest = interest;
	}
	
}
